<template>
    <div class="fysxc wh100p">
        <!-- nav -->
        <div class="w100p h50x">
            <van-nav-bar>
                <template #left>
                    <span class="t16 tc-35">订单</span>
                </template>
            </van-nav-bar>
        </div>
        <!-- order list -->
        <div class="fx-g1 fysxc w100p ovy-s" v-if="orderlist.length != 0">
            <div>
                <order-item v-for="(item,index) in orderlist" :key="item.id" :indata="item" :index="index" />
                <div class="h50x pt10 t12-c">已经到底了......</div>
            </div>
        </div>
        <div class="fx-g1 w100p fysxc bsb pt100" v-if="orderlist.length == 0">
            <img src="@/assets/img/none.png">
            <span class="m30 t12">空空如也，快去下单吧！！</span>
            <div class="w180 h30 bgc-dca974 fxcyc tc-f t14" @click="skipGoods">去点单</div>
        </div>
    </div>
</template>

<script>
import { NavBar} from "vant";
import OrderItem from "@/components/OrderItem.vue";
export default {
    name: "Order",
    components: {
        VanNavBar: NavBar,
        OrderItem,
    },
    computed: {
        orderlist() {
            return this.$store.getters.getOrder;
        }
    },
    methods:{
        skipGoods(){
            this.$router.push('/Goods')
        }
    }
};
</script>
